package com.jieshen.lesson5;

import javax.swing.*;
import java.awt.*;

public class JScrollDemo extends JFrame {
    public JScrollDemo() {
        Container contentPane = this.getContentPane();

        //文本域
        JTextArea textArea = new JTextArea(20, 50);
        textArea.setText("欢迎学习Swing");

        JScrollPane scrollPane = new JScrollPane(textArea);
        contentPane.add(scrollPane);

        setVisible(true);
        setBounds(100,100,300,350);
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    }

    public static void main(String[] args) {
        new JScrollDemo();
    }
}
